package com.lbw.controller;


import com.lbw.entity.StudentEntity;
import com.lbw.entity.Subject;
import com.lbw.result.Result;
import com.lbw.result.ResultFactory;
import com.lbw.service.StudentEntityService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lbw
 * @since 2020-09-13
 */
@RestController
@RequestMapping("/studentEntity")
@Api(tags = "学生信息")
public class StudentEntityController {

    @Autowired
    private StudentEntityService studentEntityService;

    /**
     * 获取所有学生信息
     * @return
     */
    @GetMapping("selectStudent")
    @ApiOperation("获取所有学生信息")
    public Result selectStudent() {
        List<StudentEntity> studentEntityList = studentEntityService.list(null);
        if (studentEntityList != null && !studentEntityList.isEmpty()) {
            for (StudentEntity studentEntity : studentEntityList) {
                studentEntity.setPassword("******");
            }
        }
        return ResultFactory.success(studentEntityList);
    }



}

